﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;
using Abp.Application.Services.Dto;
using Abp.AutoMapper;
using AutoMapper;
using FwProject.Authorization.Users;
using FwProject.Core.Restaurant;

namespace FwProject.Restaurant.Dto
{
    [AutoMap(typeof(RestaurantInfo))]
    public class RestaurantInputDto
    {
        /// <summary>
        /// 餐厅地址
        /// </summary>
        /// <value>The restaurant address.</value>
        [Required(ErrorMessage ="{0}不能为空")]
        [StringLength(RestaurantInfo.StringLength,ErrorMessage = "不能超过{1}个字符")]
        [Display(Name="餐厅地址")]
        public string RestaurantAddress { get; set; }


        /// <summary>
        /// 餐厅名称
        /// </summary>
        /// <value>The name of the restaurant.</value>
        [Required(ErrorMessage = "{0}不能为空")]
        [StringLength(RestaurantInfo.StringLength, ErrorMessage = "不能超过{1}个字符")]
        [Display(Name = "餐厅名称")]
        public string RestaurantName { get; set; }


        /// <summary>
        /// 经度
        /// </summary>
        /// <value>The longitude.</value>
        [Required(ErrorMessage = "{0}不能为空")]
        [StringLength(RestaurantInfo.StringLength, ErrorMessage = "不能超过{1}个字符")]
        [Display(Name ="经度")]
        public string longitude { get; set; }


        /// <summary>
        /// 纬度
        /// </summary>
        /// <value>The latitude.</value>
        [Required(ErrorMessage = "{0}不能为空")]
        [StringLength(RestaurantInfo.StringLength, ErrorMessage = "不能超过{1}个字符")]
        [Display(Name ="纬度")]
        public string latitude { get; set; }
        /// <summary>
        /// 餐厅绑定司机
        /// </summary>
        /// <value>The employee driverid.</value>
        [Required(ErrorMessage = "{0}不能为空")]
        [Display(Name ="司机编号")]
        public long EmployeeDriverid { get; set; }

        /// <summary>
        /// 司机名称
        /// </summary>
        [IgnoreMap]
        public string DriveridName { get; set; }
        
        /// <summary>
        /// 餐厅logo 图片
        /// </summary>
        /// <value>The thump.</value>
        //[Required(ErrorMessage = "{0}不能为空")]
        [Display(Name = "餐厅logo图片")]
        public string Thump { get; set; }

        [Display(Name ="餐厅型号")]
        [IgnoreMap]
        public List<TypeNumberDto> TypenNumberInfos { get; set; }

        [IgnoreMap]
        [Display(Name = "餐厅人员")]
        public string RestaurantUserInputs { get; set; } = "";

        [IgnoreMap]
        public List<RestaurantUserDto> RestaurantUsers { get; set; }

        /// <summary>
        /// 收费方式
        /// </summary>
        [Display(Name = "收费方式")]
        public ChargeWayEnum ChargeWay { get; set; } = ChargeWayEnum.按套收费;
        /// <summary>
        /// 结算方式
        /// </summary>
        [Display(Name = "结算方式")]
        public BalanceWayEnum BalanceWay { get; set; } = BalanceWayEnum.定期结算;
        /// <summary>
        /// 结算周期
        /// </summary>
        [Display(Name = "结算周期")]
        public BalanceCycleEnum BalanceCycle { get; set; } = BalanceCycleEnum.每月定期;
        /// <summary>
        /// 是否停用
        /// </summary>
        [Display(Name = "停用标志")]
        public bool IsDiscontinuation { get; set; } = false;
        /// <summary>
        /// 停用时间
        /// </summary>
        [Display(Name = "停用时间")]
        public DateTime? DiscontinuationTime { get; set; }
        /// <summary>
        /// 收取押金
        /// </summary>
        [Display(Name = "押金金额")]
        public double Deposit { get; set; }
        /// <summary>
        /// 押金收取日期
        /// </summary>
        [Display(Name = "押金收取日期")]
        public DateTime? DepositDate { get; set; }
        /// <summary>
        /// 期初店存
        /// </summary>
        [Display(Name = "期初店存")]
        public int Stock { get; set; }

        /// <summary>
        /// 店存更新时间
        /// </summary>
        [Display(Name ="店存更新时间")]
        public DateTime? StockTime { get; set; }

        [Display(Name = "备注")]
        public string RemarkContent { get; set; }

        public class TypeNumberDto:EntityDto<Guid>
        {
            public Guid? TypeNumberId { get; set; }
            [Display(Name ="单价")]
            public decimal Price { get; set; } = 1;
        }
    }
}
